package com.book.feign;

import com.book.entity.BookEntity;
import com.book.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient("book-info")
public interface CartFeign {


    @GetMapping("/book/info/get/cart/{userId}")
    R getCart(@PathVariable("userId")Long userId);

    @PostMapping("/book/info/clear/cart/{userId}")
    R clearCart(@PathVariable("userId")Long userId);

    @PostMapping("/book/info/update")
    R update(@RequestBody BookEntity book);

}
